<template>
  <!-- 模拟分析 -->
    <j-modal
    title="AI模拟分析"
    :width="1100"
    switchFullscreen
    :fullscreen="false"
    :draggable="true"
    :okButtonProps="{ class: { 'jee-hidden': true } }"
    @cancel="handleModalCancel"
    :cancelButtonProps="{ class: { 'jee-hidden': true } }"
    :visible="modalVisible"
    :body-style="{ padding: '0px' }"
    class="ai-sfk-modal"
  >
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="">
              <j-input placeholder="请输入数据集名称" v-model="queryParam.name" style="background-color: #393939; border-color: #747474; color: #ddd"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置 </a-button> -->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap" 
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">数据预测</a>
        </span>
      </a-table>
    </div>
    <extract-modal ref="modalForm" @ok="modalFormOk"></extract-modal>
    <extract-result-modal ref="modalResult"></extract-result-modal>
  </a-card>
    </j-modal>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import '@/assets/less/TableExpand.less'
import ExtractModal from '@/views/corp/quotaForecast//ExtractModal'
import ExtractResultModal from '@/views/corp/quotaForecast/ExtractResultModal' 
export default {
  name: 'DataSetBuild',
  mixins: [JeecgListMixin],
  components: {
    ExtractModal,
    ExtractResultModal,
  },
  data() {
    return {
      description: '模拟分析',
      modalVisible:false,
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '数据集名称',
          align: 'center',
          dataIndex: 'name',
          width: 200,
        }, 
        {
          title: '类型',
          align: 'center',
          dataIndex: 'dsType',
          width: 150,
        },
        {
          title: '数据量',
          align: 'center',
          dataIndex: 'dataSize',
          width: 200,
        },
         {
          title: '槽号',
          align: 'center',
          dataIndex: 'slotNo',
          width: 200,
        }, 
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center', 
          width: 160,
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        list: '/dataSet/dataSet/list',
        delete: '/dataSet/dataSet/delete',
        deleteBatch: '/userFormula/userFormula/deleteBatch',
        exportXlsUrl: '/userFormula/userFormula/exportXls',
        importExcelUrl: 'userFormula/userFormula/importExcel',
      },
      dictOptions: {},
      superFieldList: [],
       ipagination: {
          current: 1,
          pageSize: 10,
          pageSizeOptions: ['5', '10', '20', '30'],
          showTotal: (total, range) => {
            return ' 共' + total + '条'
          },
          showQuickJumper: false,
          showSizeChanger: false,
          total: 0
        },
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {},
  methods: {
    show() {
      this.modalVisible = true
    },
    handleModalCancel() {
      this.modalVisible = false
    },
    initDictConfig() {},
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'formulaName', text: '公式名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'formulaContent', text: '内容', dictCode: '' })
      fieldList.push({ type: 'date', value: 'modifyDate', text: '修改日期' })
      fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' })
      fieldList.push({ type: 'int', value: 'seqNo', text: '序号，用于公式排序', dictCode: '' })
      fieldList.push({ type: 'string', value: 'userId', text: '创建人', dictCode: '' })
      this.superFieldList = fieldList
    },
    modalFormOk(data) { 
      this.$refs.modalResult.show(data)
    },
    handleEdit(record) {
      this.$refs.modalForm.edit(record);  
    },
  },
}
</script> 

<style scoped lang="less">
@import '~@assets/less/common.less';
table:hover,
tr:hover,
thead:hover {
  background: #20293c !important;
}

.ai-sfk-modal {
  /deep/.ant-modal-content {
    background: transparent;
  }
  /deep/.ant-modal-footer {
    border: none;
  }
  /deep/.ant-modal-header,
  .ant-card,
  .ant-card-body {
    background-color: rgba(255, 255, 255, 0.2); /* 半透明背景 */
    backdrop-filter: blur(20px); /* 背景模糊 */
    -webkit-backdrop-filter: blur(10px); /* 兼容老版本 Safari */
    color: #ddd;
    border-bottom: 0px;
  }
  /deep/.ant-modal-title,
  /deep/.ant-modal-close {
    color: #ccc;
  }
  // /deep/.ant-modal-body {
  //   background-color: rgba(255, 255, 255, 0.2); /* 半透明背景 */
  //   backdrop-filter: blur(20px); /* 背景模糊 */
  //   -webkit-backdrop-filter: blur(10px); /* 兼容老版本 Safari */
  // }
  /deep/.ant-table-tbody > tr.ant-table-row:hover > td,
  .ant-table-tbody > tr > td.ant-table-cell-row-hover,
  .ant-table-row-hover {
    background: #336;
  }
  /deep/.ant-table {
    background-color: #4c4d4d;
    height: 507px;
  }
  /deep/.ant-table-middle
    > .ant-table-content 
    > .ant-table-body
    > table
    > .ant-table-thead
    > tr
    > th {
    background-color: #393939;
    color: #ddd;
  }

  /deep/.ant-table-middle
    > .ant-table-content
    > .ant-table-body
    > table
    > .ant-table-thead
    > tr
    > th {
    background: #333;
    color: #ddd;
  }
  
  /deep/.ant-table-bordered .ant-table-thead > tr > th,
  .ant-table-bordered .ant-table-tbody > tr > td {
    border-color: #747474;
  }
  /deep/.ant-table-middle > .ant-table-content > .ant-table-body > table > .ant-table-tbody > tr > td{
    color: #ddd;
  }
  /deep/.ant-table-middle > .ant-table-content > .ant-table-fixed-right > .ant-table-body-outer > .ant-table-body-inner > table > .ant-table-tbody > tr > td{
    background-color: #393939;
  }
  /deep/.ant-table-bordered .ant-table-body > table {
    border-color: #747474;
  }
  /deep/.ant-table-tbody > tr > td {
    border-color: #747474;
  }
  /deep/.ant-table-placeholder{
    background: transparent;
    border: none;
    .ant-empty-description{
       color: #ddd;
    }
  }

  /deep/.ant-pagination {
    color: #ddd;
    .ant-pagination-item a {
      color: #ddd;
    }
    .ant-pagination-item-active a {
      color: #1890ff;
    }
    .ant-pagination-item-link {
      background: #ccc;
    }
  }
}
</style>